<?php


if (!is_object(cmsms())) exit;
#if (!$this->CheckPermission('Manage Counters Made Simple')) exit;

if(!empty($params['cntr_id']))
{
    $sid = $params['cntr_id'];
    $query = 'DELETE FROM ' . cms_db_prefix() . 'module_counters where cntr_id = ?';
    $dbresult = $db->Execute($query, array($sid));
    if(!$dbresult)
    {
        die("Error ".$db->ErrorMsg());
    }
} 

$this->Redirect($id, "defaultadmin", '', array('msg'=>'message_success', 'tab'=>'counters'));
$this->Redirect($id, 'defaultadmin', $returnid, $parms);
?>